from command import *
from facility import *

__all__ = [
    "NoCommand", "CeilingFanOnCommand", "CeilingFanOffCommand",
    "GarageDoorUpCommand", "GarageDoorDownCommand",
    "HotTubOnCommand", "HotTubOffCommand",
    "LightOnCommand", "LightOffCommand",
    "StereoOnWithCDCommand", "StereoOffCommand"
]

class NoCommand(Command):
    def execute(self):
        pass

    def undo(self):
        pass


class CeilingFanOnCommand(Command):
    def __init__(self, ceiling_fan: CeilingFan):
        self._ceiling_fan = ceiling_fan

    def execute(self):
        self._ceiling_fan.high()


class CeilingFanOffCommand(Command):
    def __init__(self, ceiling_fan: CeilingFan):
        self._ceiling_fan = ceiling_fan

    def execute(self):
        self._ceiling_fan.off()


class GarageDoorUpCommand(Command):
    def __init__(self, garage_door: GarageDoor):
        self._garage_door = garage_door

    def execute(self):
        self._garage_door.up()


class GarageDoorDownCommand(Command):
    def __init__(self, garage_door: GarageDoor):
        self._garage_door = garage_door

    def execute(self):
        self._garage_door.down()


class HotTubOnCommand(Command):
    def __init__(self, hot_tub: HotTub):
        self._hot_tub = hot_tub

    def execute(self):
        self._hot_tub.on()
        self._hot_tub.heat()
        self._hot_tub.bubbles_on()


class HotTubOffCommand(Command):
    def __init__(self, hot_tub: HotTub):
        self._hot_tub = hot_tub

    def execute(self):
        self._hot_tub.cool()
        self._hot_tub.off()


class LightOnCommand(Command):
    def __init__(self, light: Light):
        self._light = light

    def execute(self):
        self._light.on()


class LightOffCommand(Command):
    def __init__(self, light: Light):
        self._light = light

    def execute(self):
        self._light.off()


class StereoOnWithCDCommand(Command):
    def __init__(self, stereo: Stereo):
        self._stereo = stereo

    def execute(self):
        self._stereo.on()
        self._stereo.set_cd()
        self._stereo.set_volume(11)


class StereoOffCommand(Command):
    def __init__(self, stereo: Stereo):
        self._stereo = stereo

    def execute(self):
        self._stereo.off()
